Step 1 - Prepare the nodes in your project

Before you can create reflections, you have to prepare the nodes in your project for which you want to create reflections.

In this step you first use an Empty Node 3D node and define its Scale property value to create a mirror image of all nodes it contains. Then you use Instantiator nodes that create a visual copy of the nodes for which you want to create reflections, including lights, and create a reflection plane.

Along the way you use tags to mark the node either as origin or a reflection. In the next step of the tutorial you use these tags to collect the nodes with two tag filters and pass each to a different render pass.

Assets for the tutorial

The starting point of this tutorial is the Reflections.kzproj Kanzi Studio project file stored in the <KanziWorkspace>/Tutorials/Reflections/Assets directory.

The <KanziWorkspace>/Tutorials/Reflections/Completed directory contains the completed project of this tutorial.

Prepare the nodes in your project

  1. In Kanzi Studio open the project stored in <KanziWorkspace>/Tutorials/Reflections/Assets.
    This project contains a Trajectory List Box 3D node with several 3D models and lights. In this tutorial you create the reflection of these nodes.
  2. In the Project press Alt and right-click the Scene node with the nodes for which you want to create a reflection, select Empty Node 3D, and name it Reflection.
    You use this node to create the mirror reflection.
  3. In the Properties add the Render Transformation property, disable the Uniform option, and set:
  4. In the Project select or create the nodes for which you want to create reflections (including all the lights), and in the Properties set the Tags property to Origin.
    For example, in the Project select the Directional Light, Trajectory List Box 3D, and both Point Light nodes.
    If you have more than one node and you want to create a reflection for all nodes, group them under the same node, and tag their parent node. For example, place the nodes into a Trajectory List Box 3D or an Empty Node.
  5. Create the Instantiator nodes from the nodes for which you want to create a reflection:
    1. In the Project press Alt and right-click the Trajectory List Box 3D node, select Instantiate Into an Instantiator.
      You use the Instantiator nodes to create a visual copy of the nodes for which you want to create reflections.
    2. In the Properties set the Tags property to Reflection.
    3. Move the Instantiator node to the Reflection node.
  6. Repeat the previous step for the Directional Light and both Point Light nodes.
  7. In the Project create a reflection plane in the same scene where you created the origin and reflection nodes.
    For example, press Alt and right-click the Scene node, select Plane, and name it Reflection plane.
  8. In the Project select the Reflection plane node and in the Properties add and set:
  9. In the Preview click Edit and use the Node tool to rotate, scale, and position the Reflection plane between the origin and reflection nodes.

< PREVIOUS STEP

NEXT STEP >

See also

To find out more about how to use tags, see Tags.